package shopping.ui;

import java.util.List;
import java.util.Map;

import test.main.R;
import util.Util;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import android.widget.SimpleAdapter;

public class LpSimpleAdapter extends SimpleAdapter {

	private Context m_Context;
	
	public LpSimpleAdapter(Context context,
			List<? extends Map<String, ?>> data, int resource, String[] from,
			int[] to) {
		super(context, data, resource, from, to);
		m_Context = context;
	}

	@Override
	public void setViewImage(ImageView v, String value) {
		Drawable drawable = Util.get_pic_by_id(value);
		v.setImageDrawable(drawable);
	}

	@Override
	public void setViewImage(ImageView v, int value) {
		// TODO Auto-generated method stub
		Drawable drawable = m_Context.getResources().getDrawable(R.drawable.photo2);
		v.setImageDrawable(drawable);
	}
	
	

}
